package uk.co.agileworks.bidpirate.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public final class LogoutController extends ControllerHelper {
	
	static final String ACCOUNT_DELETED = "redirect:/accountDeleted.html";
	
	@RequestMapping("/goodbye.html")
	public void logOut() {
		getUserSession().logOut();
	}
	
	@RequestMapping("/deleteAccount.html")
	public String deleteAccount() {
		getBusinessLogic().deleteAccount(getUserSession().getUser());
		logOut();
		return ACCOUNT_DELETED;
	}

}
